<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$Think.lang.admin}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    {include file="public/file_css"}
    <style type="text/css">
        .layui-table img{
            text-align:center;
            height: auto;
            white-space: normal;
            max-width: 50px;
        }
    </style>
</head>
<body>
<div class="layuimini-container">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend>
            <a href="#" class="layui-btn " id="adds" alt="{:url('add')}">
                <i class="fa fa-edit"></i> {$Think.lang.add}
            </a>
        </legend>
    </fieldset>

    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            {volist name="data" id="item" key="k"}
                {if $k==1}
                    <li class="layui-this">{$item.sys_title}</li>
                {else}
                    <li>{$item.sys_title}</li>
                {/if}
            {/volist}
        </ul>
        <div class="layui-tab-content">
                <span id="ActionUrl" alt="{:url('batchSave')}"></span>
                {volist name="data" id="item" key="k"}
                    {if $k==1}
                        <div class="layui-tab-item layui-show">
                            <form id="DataForm" lay-filter="DataForm" onsubmit="return false">
                                <table class="layui-table layui-form">
                                    <thead>
                                        <tr>
                                            <td>{$Think.lang.variable_title}</td>
                                            <td>{$Think.lang.variable_name}</td>
                                            <td>{$Think.lang.variable_value}</td>
                                            <td>{$Think.lang.Remark}</td>
                                            <td>{$Think.lang.operate}</td>
                                        </tr>
                                    </thead>
                                    {volist name="item.son" id="v"}
                                        <tr>
                                            <td>{$v.sys_title}</td>
                                            <td>{$v.sys_variable}</td>
                                            <td>
                                                {$v.sys_html|raw}
                                            </td>
                                            <td>{$v.sys_remark}</td>
                                            <td>
                                                <a class="layui-btn layui-btn-normal layui-btn-sm" alt="{:url('edit')}?id={$v.id}" lay-submit lay-filter="save">{$Think.lang.edit}</a>
                                            </td>
                                        </tr>
                                    {/volist}
                                </table>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="doSubmit">{$Think.lang.Save}</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    {else}
                        <div class="layui-tab-item">
                            <form id="DataForm{$k}" lay-filter="DataForm{$k}" onsubmit="return false">
                                <table class="layui-table layui-form">
                                    <thead>
                                        <tr>
                                            <td>{$Think.lang.variable_title}</td>
                                            <td>{$Think.lang.variable_name}</td>
                                            <td>{$Think.lang.variable_value}</td>
                                            <td>{$Think.lang.Remark}</td>
                                            <td>{$Think.lang.operate}</td>
                                        </tr>
                                    </thead>
                                    {volist name="item.son" id="v"}
                                        <tr>
                                            <td>{$v.sys_title}</td>
                                            <td>{$v.sys_variable}</td>
                                            <td>
                                                {$v.sys_html|raw}
                                            </td>
                                            <td>{$v.sys_remark}</td>
                                            <td>
                                                <a class="layui-btn layui-btn-normal layui-btn-sm" alt="{:url('edit')}?id={$v.id}" lay-submit lay-filter="save">{$Think.lang.edit}</a>
                                            </td>
                                        </tr>
                                    {/volist}
                                </table>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="doSubmit">{$Think.lang.Save}</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    {/if}
                {/volist}

        </div>
    </div>
</div>
{include file="public/file_js"}
<script>
    layui.use(['table','form'], function () {
        var $ = layui.jquery;
        var form = layui.form;
        var table = layui.table;

        //添加、编辑
        $('#adds').click(function () {
            let JumpUrls = $('#adds').attr('alt');
            if(JumpUrls == ''){
                JumpUrls = 'add';
            }
            parent.layer.open({
                type:2,
                title:'信息',
                content:JumpUrls,
                shadeClose: true,
                maxmin:true,
                area:[$(window).width()*0.9+'px',$(window).height() - 50+'px']
            });
        });
    });
</script>
</body>
</html>